package model.sensors;

import model.components.ComponentDoor;
import model.components.ComponentSensor;

public class SensorDoor extends ComponentSensor {

	public SensorDoor(String pLabel, int pMode, Object pComponentReference) {
		super(pLabel, pMode, pComponentReference);
	}

	public boolean isOpened() {
		return ((ComponentDoor) (this.componentReference)).isOpened();
	}

	public int getDoorId() {
		return ((ComponentDoor) (this.componentReference)).getComponentId();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return super.toString() + " SensorDoor [isOpened()=" + isOpened() + ", getDoorId()=" + getDoorId() + "]\n";
	}
}